import request from '@/utils/request'
import qs from 'qs'

/**
 * 获取列表
 * @param limit
 * @param offset
 */
export function page(limit, offset
) {
  return request({
    url: '/system/baseAppUpdate/getPage',
    method: 'post',
    data: qs.stringify({
      limit, offset
    })
  })
}

/**
 * 获取详情
 * @param id
 */
export function getInfo(id) {
  return request({
    url: '/system/baseAppUpdate/getInfo',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}

/**
 * 新增或编辑
 * @param id
 * @param name
 * @param menuKey
 * @param pId
 * @param type
 */
export function addOrEdit(id, deviceInfo, version, down, putawayState, coerceUp, updateText, packageName) {
  return request({
    url: '/system/baseAppUpdate/addOrEdit',
    method: 'post',
    data: qs.stringify({
      id, deviceInfo, version, down, putawayState, coerceUp, updateText, packageName
    })
  })
}

/**
 * 删除
 * @param id
 */
export function delInfo(id) {
  return request({
    url: '/system/baseAppUpdate/del',
    method: 'post',
    data: qs.stringify({
      id
    })
  })
}
